package order.service.service;

import order.service.mapper.OrderMapper;
import order.service.model.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import product.api.ProductApi;
import product.model.ProductInfo;

import java.util.ArrayList;
import java.util.HashMap;

@Service
public class OrderService {
    @Autowired
    OrderMapper orderMapper;
    @Autowired
    RestTemplate restTemplate;

    @Autowired
    ProductApi productApi;
    public OrderInfo getOrderInfoById(Integer id) {
        OrderInfo orderInfo = orderMapper.getOrderInfoById(id);
        ProductInfo productInfo = productApi.getProductInfoById(orderInfo.getProductId());
        orderInfo.setProductInfo(productInfo);
        HashMap
        return orderInfo;
    }
}
